import {createRouter, createWebHistory} from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
    {
        path: '/',
        name: 'home',
        component: HomeView
    },
    {
        path: '/about',
        name: 'about',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('../views/Login.vue')
    },
    {
        path: '/index',
        name: 'index',
        component: () => import('../components/Index.vue'),
        children: [
            {
                path: '/index/human',
                name: 'human',
                component: () => import('../components/humanResourse/HumanResourse.vue')
            },
            {
                path: '/index/system',
                name: 'system',
                component: () => import('../components/system/System.vue')
            }
        ]
    },
	{
		path:'/humanres',
		name:'humanres',
		component:()=>import('../components/humanResourse/humanRes.vue'),
		children: [
		    {
		        path: '/humanres/tocompanyindex',
		        name: 'tocompanyindex',
		        component: () => import('../components/humanResourse/toCompany/ToCompanyIndex.vue')
		    },
			{
				path: '/humanres/tocompanyemploy',
				name: 'tocompanyemploy',
				component: () => import('../components/humanResourse/toCompany/ToCompanyFromEmploy.vue')
			},
			{
				path: '/humanres/tocompanysociety',
				name: 'tocompanysociety',
				component: () => import('../components/humanResourse/toCompany/ToCompanyFromSociety.vue')
			},
			{
				path: '/humanres/trialindex',
				name: 'trialindex',
				component: () => import('../components/humanResourse/trial/TrialIndex.vue'),
				children: [
					{
						path: '/humanres/trialindex/trialmember',
						name: 'trialmember',
						component: () => import('../components/humanResourse/trial/TrialMember.vue')
					},
					{
						path: '/humanres/trialindex/trialtoemp',
						name: 'trialtoemp',
						component: () => import('../components/humanResourse/trial/TrialToEmp.vue')
					}
				]
			},
			{
				path: '/humanres/managerindex',
				name: 'managerindex',
				component: () => import('../components/humanResourse/manager/ManagerIndex.vue'),
				children: [
					{
						path: '/humanres/managerindex/managerdept',
						name: 'managerdept',
						component: () => import('../components/humanResourse/manager/ManagerDept.vue')
					},
					{
						path: '/humanres/managerindex/managerpost',
						name: 'managerpost',
						component: () => import('../components/humanResourse/manager/ManagerPost.vue')
					}
				]
			}						
		]
	}

]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
